<template>
  <div class="dashboard-editor-container">
    <panel-group v-if="dataList != null" :lineChartData=dataList />
    <el-row style="background:#fff;margin-bottom:16px;">
    <line-chart v-if="dataList != null" :lineChartData=dataList  />
    </el-row>
    <el-row :gutter="24">
      <el-col :xs="24" :sm="24" :lg="12">
        <div class="chart-wrapper">
          <pie-chart v-if="dataList != null" :lineChartData=dataList  />
        </div>
      </el-col>
      <el-col :xs="24" :sm="24" :lg="12">
        <div class="chart-wrapper">
          <bar-chart  v-if="dataList != null" :lineChartData=dataList />
        </div>
      </el-col>
    </el-row>
     <el-row>
      <el-col :xs="24" :sm="24" :lg="24">
        <div class="copyRight" v-if="dataList != null">
           Copyright ©2021-2023 通用玻璃软件
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import PanelGroup from './dashboard/PanelGroup'
import LineChart from './dashboard/LineChart'
import RaddarChart from './dashboard/RaddarChart'
import PieChart from './dashboard/PieChart'
import BarChart from './dashboard/BarChart'
import {listHome} from '@/api/assembly/statistics'

export default {
  name: 'Index',
  components: {
    PanelGroup,
    LineChart,
    RaddarChart,
    PieChart,
    BarChart
  },
  data() {
    return {
      dataList: null,
    }
  },
  created(){
    this.getList();
  },
  methods: {
    getList(){
      listHome().then(res => {
        this.dataList = res.rows[0];
      });
    },
  }
}
</script>

<style lang="scss" scoped>
.dashboard-editor-container {
  min-height: 100%;
  padding: 0 18px;
  background-color: rgb(240, 242, 245);
  position: relative;
  .chart-wrapper {
    background: #fff;
    padding: 16px 16px 0;
    margin-bottom: 16px;
  }
}

@media (max-width:1024px) {
  .chart-wrapper {
    padding: 8px;
  }
}
.copyRight{
  color: gray;
  font-size: 18px;
  text-align: center;
}
</style>
